package com.hwua.service.Impl;

import com.hwua.dao.IUserDao;
import com.hwua.dao.Impl.UserDaoImpl;
import com.hwua.entity.User;
import com.hwua.service.IUserService;

public class UserServiceImpl implements IUserService {
    private IUserDao iUserDao=new UserDaoImpl();
    @Override
    public User login(User user) throws Exception {
        return iUserDao.query(user);
    }

    @Override
    public boolean register(User user) throws Exception {
        return iUserDao.insert(user)==1?true:false;
    }

    @Override
    public int updatePwd(User user) throws Exception {
        return iUserDao.update(user);
    }

    @Override
    public User upPWD(String name, String email) throws Exception {
        return iUserDao.query(name,email);
    }
}
